package cc.wsyw126.java.mock;

/**
 * Created by junpeng.yang on 16/8/18.
 */
public class Demo {
    private String name ="laowang";
    private int age;


    public Demo(){}

    public Demo(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String speak(String str) {
        System.out.println("str = " + str);
        System.out.println("name = " + name);
        return str;
    }

    public String speakTwoWord(String str,int num) {
        System.out.println("str+num = " + str + num);
        return str+num;
    }

    public String speakSomeWorld(Integer I){
        return I.toString();
    }
    public String talk(String str)
    {
        return str;
    }
    public String methodNoParameters()
    {
        return name;
    }

    public String methodCustomParameters(ParameterClass parameter,String str)
    {
        parameter.setAge(12);
        parameter.setName("asd");
        return str+parameter.toString();
    }

    public String methodHaveChildObj(ParameterClass parameter,String str)
    {
        parameter.childTalk(str);
        return str;
    }

    public void spy(){
        this.speak("speak");
        this.speakTwoWord("1", 2);
    }
}
